package com.rrqs.activity;

import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.rrqs.activity.adapter.ImpressionLabelsListAdapter;
import com.zadtek.xmqishi.R;

import java.util.ArrayList;
import java.util.List;

public class PersonalInformationActivity extends BaseActivity {
    private TextView topview;
    private ImageView backid;
    private ImageView user_headImg;
    private TextView user_name;
    private TextView user_phoneNumber;
    private TextView idAndRegisteredTime;
    private TextView user_address;
    private TextView customer_satisfaction_rate;
    private TextView distribution_on_time_rate;
    private TextView delivery_distance;
    private TextView history_orders_num;
    private RecyclerView impressionLabelsList;
    private ImpressionLabelsListAdapter adapter;
    private List<String> datas;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_personal_information);

        initView();
        initData();
    }

    private void initData() {
        if (datas == null) {
            datas = new ArrayList<>();
        } else {
            datas.clear();
        }
        for (int i = 0; i < 10; i++) {
            datas.add("快速准时 +60");
        }
        adapter = new ImpressionLabelsListAdapter(this, datas);
        impressionLabelsList.setAdapter(adapter);
    }

    private void initView() {
        topview = findViewById(R.id.topview);
        backid = findViewById(R.id.backid);
        user_headImg = findViewById(R.id.user_headImg);
        user_name = findViewById(R.id.user_name);
        user_phoneNumber = findViewById(R.id.user_phoneNumber);
        idAndRegisteredTime = findViewById(R.id.idAndRegisteredTime);
        user_address = findViewById(R.id.user_address);
        customer_satisfaction_rate = findViewById(R.id.customer_satisfaction_rate);
        distribution_on_time_rate = findViewById(R.id.distribution_on_time_rate);
        delivery_distance = findViewById(R.id.delivery_distance);
        history_orders_num = findViewById(R.id.history_orders_num);
        impressionLabelsList = findViewById(R.id.impressionLabelsList);
        impressionLabelsList.setLayoutManager(new GridLayoutManager(this, 4));

        topview.setText("我的");
        backid.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }
}
